package cn.myzf.chatapi.wechat.utils;

import cn.myzf.chatapi.WeChatClient;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;

/**
 * @Description: 线程id和FutureTask的关联关系处理
 */
public class WxClientRel {

	private static ConcurrentHashMap<String, Object> manager = new ConcurrentHashMap<>();

	public static void put(String wxId, Object  weChatClient) {
		manager.put(wxId, weChatClient);
	}

	public static void remove(String wxId, Object  weChatClient) {
		manager.remove(wxId, weChatClient);
	}

	public static Object  get(String wxId) {
		return manager.get(wxId);
	}
	
	public static void output() {
		for (ConcurrentHashMap.Entry<String, Object > entry : manager.entrySet()) {
			System.out.println("wxId: " + entry.getKey()
							+ ", WeChatClient: " + entry.getValue());
		}
	}
}
